<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<title>小游戏</title>
	<style>
		html, body{
		  height:100%; overflow:hidden; 
		}
		body { margin:0; }
	</style>
	<script src="ruffle.js"></script>
</head>
<body>
	<!--<object type="application/x-shockwave-flash" data="WebMain.swf" width="100%" height="100%">
		<param name="wmode" value="direct" />
	</object>-->
</body>
</html>

<script>
	var createSwfObject = function(src, attributes, parameters) {
		var i, html, div, obj, attr = attributes || {}, param = parameters || {};
		attr.type = 'application/x-shockwave-flash';
		if (window.ActiveXObject) {
			attr.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
			param.movie = src;
		}
		else {
			attr.data = src;
		}
		var style="style='";
		html = '<object';
		for (i in attr) {
			html += ' ' + i + '="' + attr[i] + '"';
			if(i=="width"||i=="height"){
				style+=i+":"+attr[i]+";";
			}
		}
		style+="'";
		html+=" "+style;
		html += '>';
		for (i in param) {
			html += '<param name="' + i + '" value="' + param[i] + '" />';
		}
		html += '</object>';
		div = document.createElement('div');
		div.innerHTML = html;
		obj = div.firstChild;
		div.removeChild(obj);
		return obj;
	};

	var swfEl = createSwfObject(getParameter("swf")+ '?v='+Math.random(), {id: 'myid', 'class': 'myclass', width: "100%", height: "100%"}, {wmode: 'direct',FlashVars:window.location.search.substring(1)});
	document.body.appendChild(swfEl);
	
	function getParameter(param) {
		var reg = new RegExp(".*[?,&]"+param+"=(.*?)((&.*)|$)");
		var obj = reg.exec(window.location.search);
		if(obj)return obj[1];
		else return "";
	}
</script>